<template>
  <div>
      账号: <input type="text" v-model="username">
      密码: <input type="text" v-model="password">
      <input type="button" @click="register" value="注册">
  </div>
</template>

<script>

import {register} from '@/axios封装/api'

export default {
    data(){
        return{
            username: '',
            password: '',
        }
    },
    methods: {
    register() {
      register({username: this.username, password: this.password})
        .then(res=>{
            console.log(res.data.msg)
        })
        .catch(err=>{
             console.log(res.data.msg)
        })
    }
  }
}
</script>

<style>

</style>